package com.wyl.base.bean

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable
import com.google.gson.annotations.SerializedName
import com.wyl.base.BR
import java.io.Serializable

class UserData : Serializable, BaseObservable() {
    fun clone(userData: UserData) {
        id = userData.id
        qq = userData.qq
        weixin = userData.weixin
        gold = userData.gold
        number = userData.number
        phone = userData.phone
        sex = userData.sex
        name = userData.name
        avatar = userData.avatar
        picture = userData.picture
        url = userData.url
    }

    @SerializedName("id")
    var id: String = ""

    @SerializedName("qq")
    var qq: String = ""

    @SerializedName("weixin")
    var weixin: String = ""

    @Bindable
    @SerializedName("gold")
    var gold: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.gold)
        }


    @SerializedName("number")
    var number: Int = 0

    @Bindable
    @SerializedName("phone")
    var phone: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.phone)
        }

    @SerializedName("sex")
    var sex: String = ""

    @Bindable
    @SerializedName("name")
    var name: String = ""
        set(value) {
            field = value
            notifyPropertyChanged(BR.name)
        }

    @Bindable
    @SerializedName("avatar")
    var avatar: String = ""
        set(value) {
            if (field != value) {
                field = value
                notifyPropertyChanged(BR.avatar)
            }
        }

    /**
     * 广告图片
     */
    @SerializedName("picture")
    var picture: String = ""
    /**
     * 广告url
     */
    @SerializedName("url")
    var url: String = ""
}